#ifndef WF_DRAWCIRCLECR_H
#define WF_DRAWCIRCLECR_H

#include "pf_previewactioninterface.h"
#include "pf_circle.h"
#include "gui_export.h"

/**
 * This action class can handle user events to draw 
 * simple arcs with the center, radius, start- and endangle given.
 *
 */
class GUI_EXPORT WF_DrawCircleCR : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetCenter,         /**< Setting the center point. */
		SetRadius          /**< Setting radius in command line. */
    };

public:
    WF_DrawCircleCR(PF_Container& container,
                          PF_GraphicView& graphicView);
    ~WF_DrawCircleCR();
	
	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);
	
	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionDrawCircleCR;
	}

    void reset();

    virtual void init(int status=0);

    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();
	
    virtual void hideOptions();
    virtual void showOptions();

    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

	double getRadius() {
		return data.radius;
	}

	void setRadius(double r) {
		data.radius = r;
	}

protected:
    /**
     * Circle data defined so far.
     */
    PF_CircleAttribute data;
	
};

#endif
